﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BannerLib4Net.Core.Extensions
{
    public static class Int64Extensions
    {
        public static Int64? Convert(this Int64 origin, object target)
        {
            Int64? retval = null;

            if(target != null)
            {
                Int64 evalInt64 = Int64.MinValue;

                Int64.TryParse(target.ToString(), out evalInt64);
                
                if(evalInt64 != Int64.MinValue)
                {
                    retval = evalInt64;
                }
            }

            return retval;
        }
    }
}
